package com.groupbuying.currency.consumer.service;

import com.groupbuying.currency.consumer.domain.CurrencyCustomerDO;
import com.groupbuying.currency.consumer.utils.apiresult.ApiResult;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 积分会员表
 * 
 * @author ywxd
 * @email yuwenxiaodong@126.com
 * @date 2019-04-15 17:20:51
 */
public interface CurrencyCustomerService {
	
	CurrencyCustomerDO get(String customerId);
	
	List<CurrencyCustomerDO> list(Map<String, Object> map);
	
	int count(Map<String, Object> map);
	
	int save(CurrencyCustomerDO currencyCustomer);
	
	int update(CurrencyCustomerDO currencyCustomer);
	
	int remove(String customerId);
	
	int batchRemove(String[] customerIds);

	/**
	 * Description 通过线上非积分消费，增加账户积分 <br>
	 *
	 * @author Ywxd <br>
	 * @param customerId - 积分账户Id
	 * @param payId - 支付Id
	 * @param consumptionAmount - 消费金额
	 * @param backCurrencyRatio - 返积分率
	 * @return 返回更新后的对象
	 * @createDate 2019/5/20 15:48<br>
	 **/
	CurrencyCustomerDO addCurrencyByOnlineConsumption(String customerId, String payId
			, BigDecimal consumptionAmount , BigDecimal backCurrencyRatio);

	/**
	* Description 创建积分账户 <br>
	*
	* @author Ywxd <br>
	* @param customerID
	* @return customerID
	* @createDate 2019/4/15 17:41<br>
	**/
	CurrencyCustomerDO createCurrencyCustomer(String customerID);

	/**
	 * Description 修改积分支付密码 <br>
	 *
	 * @author Ywxd <br>
	 * @param map
	 * @return 更改积分支付密码的结果
	 * @createDate 2019/5/20 15:35<br>
	 **/
	ApiResult changeCurrencyPwd(Map<String, Object> map);

	/**
	 * Description 校验积分支付密码 <br>
	 *
	 * @author Ywxd <br>
	 * @param customerId - 积分账户ID
	 * @param password - 积分支付密码
	 * @return 积分支付密码是否正确
	 * @createDate 2019/5/20 15:36<br>
	 **/
	Boolean checkCurrencyPwd(String customerId, String password);


}
